From 5a65d21795aab672b27d8672474637472ee75849 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timo=20R=C3=B6hling?= Date: Thu, 25 May 2023 14:21:55 +0200 Subject: [PATCH] Consolidate patches --- .../0001-Build-against-system-libraries.patch | 43 ++++++++++---- debian/patches/0002-Disable-Java.patch | 6 +- .../0004-Fix-combine_static_libs-macro.patch | 2 +- .../0005-Fix-list_licenses-macro.patch | 2 +- debian/patches/0006-Adjust-linker-flags.patch | 2 +- .../0009-Fix-library-export-for-Debian.patch | 56 +++---------------- .../0011-Replace-BlueGL-with-epoxy.patch | 2 +- ...-if-it-is-not-already-defined-in-ma.patch} | 0 .../patches/0012-Use-system-spirv-cross.patch | 35 ------------ ...ntifier-because-it-fails-on-mips-ar.patch} | 0 ...gnment-of-resgen-_OFFSET-and-_SIZE-.patch} | 0 ...patch => 0015-Fix-FTBFS-with-GCC-12.patch} | 0 ...around-for-armel-clang-compiler-bug.patch} | 0 ...=> 0017-Fix-TBuiltInResource-struct.patch} | 0 ...bility-with-spirv-cross-SDK-1.3.236.patch} | 0 debian/patches/series | 15 +++-- 16 files changed, 53 insertions(+), 110 deletions(-) rename debian/patches/{0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch => 0012-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch} (100%) delete mode 100644 debian/patches/0012-Use-system-spirv-cross.patch rename debian/patches/{0014-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch => 0013-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch} (100%) rename debian/patches/{0015-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch => 0014-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch} (100%) rename debian/patches/{0016-Fix-FTBFS-with-GCC-12.patch => 0015-Fix-FTBFS-with-GCC-12.patch} (100%) rename debian/patches/{0017-Workaround-for-armel-clang-compiler-bug.patch => 0016-Workaround-for-armel-clang-compiler-bug.patch} (100%) rename debian/patches/{0018-Fix-TBuiltInResource-struct.patch => 0017-Fix-TBuiltInResource-struct.patch} (100%) rename debian/patches/{0019-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch => 0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch} (100%) diff --git a/debian/patches/0001-Build-against-system-libraries.patch b/debian/patches/0001-Build-against-system-libraries.patch index 87db874..5239ab6 100644 --- a/debian/patches/0001-Build-against-system-libraries.patch +++ b/debian/patches/0001-Build-against-system-libraries.patch @@ -1,16 +1,17 @@ From: =?utf-8?q?Timo_R=C3=B6hling?= -Date: Sat, 23 Oct 2021 19:17:07 +0200 +Date: Wed, 24 May 2023 23:55:51 +0200 Subject: Build against system libraries --- - CMakeLists.txt | 38 +++++++++++++++++++++----------------- - 1 file changed, 21 insertions(+), 17 deletions(-) + CMakeLists.txt | 44 +++++++++++++++++++++++++------------------- + libs/filamat/CMakeLists.txt | 2 +- + 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa51851..b82a941 100644 +index aa51851..960f49f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -573,12 +573,25 @@ function(get_resgen_vars ARCHIVE_DIR ARCHIVE_NAME) +@@ -573,12 +573,30 @@ function(get_resgen_vars ARCHIVE_DIR ARCHIVE_NAME) endif() endfunction() @@ -18,15 +19,20 @@ index aa51851..b82a941 100644 +# External dependencies +# ================================================================================================== +find_package(GTest REQUIRED) ++find_package(astcenc REQUIRED) +find_package(tsl-robin-map REQUIRED) +find_package(meshoptimizer REQUIRED) +find_package(draco REQUIRED) ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_package(Threads REQUIRED) +if(IS_HOST_PLATFORM) + find_package(PNG REQUIRED) + find_package(SDL2 REQUIRED) + find_package(ZLIB REQUIRED) + find_package(tinyexr REQUIRED) +endif() ++include(debian/cmake/imgui.cmake) ++include(debian/cmake/stb.cmake) + # ================================================================================================== # Sub-projects @@ -37,13 +43,12 @@ index aa51851..b82a941 100644 add_subdirectory(${LIBRARIES}/camutils) add_subdirectory(${LIBRARIES}/filabridge) add_subdirectory(${LIBRARIES}/filaflat) -@@ -597,22 +610,17 @@ add_subdirectory(${FILAMENT}/filament) +@@ -597,23 +615,16 @@ add_subdirectory(${FILAMENT}/filament) add_subdirectory(${FILAMENT}/shaders) add_subdirectory(${EXTERNAL}/civetweb/tnt) add_subdirectory(${EXTERNAL}/hat-trie/tnt) -add_subdirectory(${EXTERNAL}/imgui/tnt) -add_subdirectory(${EXTERNAL}/robin-map/tnt) -+include(debian/cmake/imgui.cmake) add_subdirectory(${EXTERNAL}/smol-v/tnt) -add_subdirectory(${EXTERNAL}/benchmark/tnt) -add_subdirectory(${EXTERNAL}/meshoptimizer) @@ -53,7 +58,6 @@ index aa51851..b82a941 100644 -add_subdirectory(${EXTERNAL}/jsmn/tnt) -add_subdirectory(${EXTERNAL}/stb/tnt) +include(debian/cmake/jsmn.cmake) -+include(debian/cmake/stb.cmake) add_subdirectory(${EXTERNAL}/getopt) if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM) @@ -61,14 +65,18 @@ index aa51851..b82a941 100644 - # spirv-tools_SOURCE_DIR variable. - add_subdirectory(${EXTERNAL}/spirv-tools) - add_subdirectory(${EXTERNAL}/glslang/tnt) +- add_subdirectory(${EXTERNAL}/spirv-cross/tnt) + include(debian/cmake/spirv-tools.cmake) + include(debian/cmake/glslang.cmake) - add_subdirectory(${EXTERNAL}/spirv-cross/tnt) ++ include(debian/cmake/spirv-cross.cmake) add_subdirectory(${LIBRARIES}/filamat) -@@ -651,11 +659,7 @@ if (IS_HOST_PLATFORM) + # the material debugger requires filamat +@@ -649,13 +660,8 @@ if (IS_HOST_PLATFORM) - add_subdirectory(${EXTERNAL}/astcenc/tnt) + add_subdirectory(${FILAMENT}/samples) + +- add_subdirectory(${EXTERNAL}/astcenc/tnt) add_subdirectory(${EXTERNAL}/etc2comp) - add_subdirectory(${EXTERNAL}/libassimp/tnt) - add_subdirectory(${EXTERNAL}/libpng/tnt) @@ -79,3 +87,16 @@ index aa51851..b82a941 100644 add_subdirectory(${TOOLS}/cmgen) add_subdirectory(${TOOLS}/cso-lut) +diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt +index 9645004..2271e83 100644 +--- a/libs/filamat/CMakeLists.txt ++++ b/libs/filamat/CMakeLists.txt +@@ -104,7 +104,7 @@ if (APPLE OR MSVC) + target_link_libraries(${TARGET} glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl) + else() + target_link_libraries(${TARGET} +- -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group) ++ -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross -Wl,--end-group) + endif() + + # ================================================================================================== diff --git a/debian/patches/0002-Disable-Java.patch b/debian/patches/0002-Disable-Java.patch index dd00219..ef7de5c 100644 --- a/debian/patches/0002-Disable-Java.patch +++ b/debian/patches/0002-Disable-Java.patch @@ -7,10 +7,10 @@ Subject: Disable Java 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index b82a941..b6cd7ab 100644 +index 960f49f..d379ff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -651,10 +651,6 @@ if (IS_HOST_PLATFORM) +@@ -654,10 +654,6 @@ if (IS_HOST_PLATFORM) add_subdirectory(${LIBRARIES}/filamentapp) add_subdirectory(${LIBRARIES}/imageio) @@ -20,4 +20,4 @@ index b82a941..b6cd7ab 100644 - add_subdirectory(${FILAMENT}/samples) - add_subdirectory(${EXTERNAL}/astcenc/tnt) + add_subdirectory(${EXTERNAL}/etc2comp) diff --git a/debian/patches/0004-Fix-combine_static_libs-macro.patch b/debian/patches/0004-Fix-combine_static_libs-macro.patch index b6bc7c2..ea6fee4 100644 --- a/debian/patches/0004-Fix-combine_static_libs-macro.patch +++ b/debian/patches/0004-Fix-combine_static_libs-macro.patch @@ -7,7 +7,7 @@ Subject: Fix combine_static_libs macro 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index b6cd7ab..6786b22 100644 +index d379ff1..f637432 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,7 +495,12 @@ function(combine_static_libs TARGET OUTPUT DEPS) diff --git a/debian/patches/0005-Fix-list_licenses-macro.patch b/debian/patches/0005-Fix-list_licenses-macro.patch index 0c104cf..3d2d087 100644 --- a/debian/patches/0005-Fix-list_licenses-macro.patch +++ b/debian/patches/0005-Fix-list_licenses-macro.patch @@ -7,7 +7,7 @@ Subject: Fix list_licenses macro 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6786b22..8d674dc 100644 +index f637432..46ee62f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -475,11 +475,13 @@ function(list_licenses OUTPUT MODULES) diff --git a/debian/patches/0006-Adjust-linker-flags.patch b/debian/patches/0006-Adjust-linker-flags.patch index 981f96e..ef09c18 100644 --- a/debian/patches/0006-Adjust-linker-flags.patch +++ b/debian/patches/0006-Adjust-linker-flags.patch @@ -7,7 +7,7 @@ Subject: Adjust linker flags 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8d674dc..ce4192c 100644 +index 46ee62f..f7eb993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,12 +331,6 @@ endif() diff --git a/debian/patches/0009-Fix-library-export-for-Debian.patch b/debian/patches/0009-Fix-library-export-for-Debian.patch index 15c1757..4879353 100644 --- a/debian/patches/0009-Fix-library-export-for-Debian.patch +++ b/debian/patches/0009-Fix-library-export-for-Debian.patch @@ -1,9 +1,9 @@ From: =?utf-8?q?Timo_R=C3=B6hling?= -Date: Tue, 25 Jan 2022 22:04:07 +0100 +Date: Wed, 24 May 2023 22:47:17 +0200 Subject: Fix library export for Debian --- - CMakeLists.txt | 24 ++++++++++-- + CMakeLists.txt | 16 ++++++++ filament/CMakeLists.txt | 54 +++++++++++++++++++-------- filament/backend/CMakeLists.txt | 47 ++++++++++++++++-------- filament/benchmark/CMakeLists.txt | 3 +- @@ -37,55 +37,13 @@ Subject: Fix library export for Debian tools/mipgen/CMakeLists.txt | 2 +- tools/normal-blending/CMakeLists.txt | 2 +- tools/roughness-prefilter/CMakeLists.txt | 2 +- - 34 files changed, 508 insertions(+), 249 deletions(-) + 34 files changed, 503 insertions(+), 246 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index ce4192c..a95c557 100644 +index f7eb993..fa3099f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -577,15 +577,20 @@ endfunction() - # External dependencies - # ================================================================================================== - find_package(GTest REQUIRED) -+find_package(astcenc REQUIRED) - find_package(tsl-robin-map REQUIRED) - find_package(meshoptimizer REQUIRED) - find_package(draco REQUIRED) -+set(THREADS_PREFER_PTHREAD_FLAG ON) -+find_package(Threads REQUIRED) - if(IS_HOST_PLATFORM) - find_package(PNG REQUIRED) - find_package(SDL2 REQUIRED) - find_package(ZLIB REQUIRED) - find_package(tinyexr REQUIRED) - endif() -+include(debian/cmake/imgui.cmake) -+include(debian/cmake/stb.cmake) - - # ================================================================================================== - # Sub-projects -@@ -610,12 +615,10 @@ add_subdirectory(${FILAMENT}/filament) - add_subdirectory(${FILAMENT}/shaders) - add_subdirectory(${EXTERNAL}/civetweb/tnt) - add_subdirectory(${EXTERNAL}/hat-trie/tnt) --include(debian/cmake/imgui.cmake) - add_subdirectory(${EXTERNAL}/smol-v/tnt) - include(debian/cmake/benchmark.cmake) - add_subdirectory(${EXTERNAL}/cgltf/tnt) - include(debian/cmake/jsmn.cmake) --include(debian/cmake/stb.cmake) - add_subdirectory(${EXTERNAL}/getopt) - - if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM) -@@ -653,7 +656,6 @@ if (IS_HOST_PLATFORM) - - add_subdirectory(${FILAMENT}/samples) - -- add_subdirectory(${EXTERNAL}/astcenc/tnt) - add_subdirectory(${EXTERNAL}/etc2comp) - include(debian/cmake/libassimp.cmake) - -@@ -674,3 +676,19 @@ endif() +@@ -676,3 +676,19 @@ endif() if (NOT CMAKE_CROSSCOMPILING) export(TARGETS matc cmgen filamesh mipgen resgen glslminifier FILE ${IMPORT_EXECUTABLES}) endif() @@ -544,7 +502,7 @@ index fe5373e..683d022 100644 # ================================================================================================== # Compiler flags diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt -index 9645004..a130f0c 100644 +index 2271e83..9b38857 100644 --- a/libs/filamat/CMakeLists.txt +++ b/libs/filamat/CMakeLists.txt @@ -84,18 +84,36 @@ include_directories(${PUBLIC_HDR_DIR}) @@ -600,7 +558,7 @@ index 9645004..a130f0c 100644 else() - target_link_libraries(${TARGET} + target_link_libraries(${TARGET} PRIVATE - -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group) + -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross -Wl,--end-group) endif() @@ -151,14 +169,14 @@ set(FILAMAT_DEPS diff --git a/debian/patches/0011-Replace-BlueGL-with-epoxy.patch b/debian/patches/0011-Replace-BlueGL-with-epoxy.patch index 6e7c9ee..c1ee375 100644 --- a/debian/patches/0011-Replace-BlueGL-with-epoxy.patch +++ b/debian/patches/0011-Replace-BlueGL-with-epoxy.patch @@ -15,7 +15,7 @@ Subject: Replace BlueGL with epoxy 9 files changed, 36 insertions(+), 151 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index a95c557..5c117c3 100644 +index fa3099f..632ece6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -650,7 +650,6 @@ if (WEBGL) diff --git a/debian/patches/0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch b/debian/patches/0012-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch similarity index 100% rename from debian/patches/0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch rename to debian/patches/0012-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch diff --git a/debian/patches/0012-Use-system-spirv-cross.patch b/debian/patches/0012-Use-system-spirv-cross.patch deleted file mode 100644 index d449c51..0000000 --- a/debian/patches/0012-Use-system-spirv-cross.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: =?utf-8?q?Timo_R=C3=B6hling?= -Date: Thu, 27 Jan 2022 19:50:26 +0100 -Subject: Use system spirv-cross - ---- - CMakeLists.txt | 2 +- - libs/filamat/CMakeLists.txt | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5c117c3..632ece6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -624,7 +624,7 @@ add_subdirectory(${EXTERNAL}/getopt) - if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM) - include(debian/cmake/spirv-tools.cmake) - include(debian/cmake/glslang.cmake) -- add_subdirectory(${EXTERNAL}/spirv-cross/tnt) -+ include(debian/cmake/spirv-cross.cmake) - add_subdirectory(${LIBRARIES}/filamat) - - # the material debugger requires filamat -diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt -index a130f0c..9b38857 100644 ---- a/libs/filamat/CMakeLists.txt -+++ b/libs/filamat/CMakeLists.txt -@@ -122,7 +122,7 @@ if (APPLE OR MSVC) - target_link_libraries(${TARGET} glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl) - else() - target_link_libraries(${TARGET} PRIVATE -- -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group) -+ -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross -Wl,--end-group) - endif() - - # ================================================================================================== diff --git a/debian/patches/0014-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch b/debian/patches/0013-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch similarity index 100% rename from debian/patches/0014-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch rename to debian/patches/0013-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch diff --git a/debian/patches/0015-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch b/debian/patches/0014-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch similarity index 100% rename from debian/patches/0015-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch rename to debian/patches/0014-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch diff --git a/debian/patches/0016-Fix-FTBFS-with-GCC-12.patch b/debian/patches/0015-Fix-FTBFS-with-GCC-12.patch similarity index 100% rename from debian/patches/0016-Fix-FTBFS-with-GCC-12.patch rename to debian/patches/0015-Fix-FTBFS-with-GCC-12.patch diff --git a/debian/patches/0017-Workaround-for-armel-clang-compiler-bug.patch b/debian/patches/0016-Workaround-for-armel-clang-compiler-bug.patch similarity index 100% rename from debian/patches/0017-Workaround-for-armel-clang-compiler-bug.patch rename to debian/patches/0016-Workaround-for-armel-clang-compiler-bug.patch diff --git a/debian/patches/0018-Fix-TBuiltInResource-struct.patch b/debian/patches/0017-Fix-TBuiltInResource-struct.patch similarity index 100% rename from debian/patches/0018-Fix-TBuiltInResource-struct.patch rename to debian/patches/0017-Fix-TBuiltInResource-struct.patch diff --git a/debian/patches/0019-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch b/debian/patches/0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch similarity index 100% rename from debian/patches/0019-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch rename to debian/patches/0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch diff --git a/debian/patches/series b/debian/patches/series index 83f6b96..e9f0d4d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,11 +9,10 @@ 0009-Fix-library-export-for-Debian.patch 0010-Rename-resgen-executable-to-avoid-conflict-with-mono.patch 0011-Replace-BlueGL-with-epoxy.patch -0012-Use-system-spirv-cross.patch -0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch -0014-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch -0015-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch -0016-Fix-FTBFS-with-GCC-12.patch -0017-Workaround-for-armel-clang-compiler-bug.patch -0018-Fix-TBuiltInResource-struct.patch -0019-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch +0012-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch +0013-Avoid-mips-as-identifier-because-it-fails-on-mips-ar.patch +0014-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch +0015-Fix-FTBFS-with-GCC-12.patch +0016-Workaround-for-armel-clang-compiler-bug.patch +0017-Fix-TBuiltInResource-struct.patch +0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch -- 2.30.2